

Component({
  pageLifetimes: {
    show() {
      this.wtest()
    },
  },


  data: {
    buttons: [
      { id: 1, name: '接单额',checked:true }, 
      { id: 2, name: '出货额',checked:false }, 
      { id: 3, name: '回款额',checked:false }, 
      { id: 4, name: '应收未收',checked:false }, 
      { id: 5, name: '毛利率',checked:false }, 
      { id: 6, name: '准交率',checked:false }, 
      { id: 7, name: '投诉数',checked:false }
    ],
    tableHeader: [
      {
        prop: 'datetime',
        width: 110,
        label: '销售单位',
        color: 'red'
      },
      {
        prop: 'sign_in_time',
        width: 90,
        label: '接单额'
      },
      {
        prop: 'sign_out_time',
        width: 90,
        label: '出货额'
      },
      {
        prop: 'work_hour',
        width: 90,
        label: '回款额'
      },
      {
        prop: 'status',
        width: 95,
        label: '应收未收'
      },
      {
        prop: 'status',
        width: 90,
        label: '毛利率'
      },
      {
        prop: 'status',
        width: 90,
        label: '准交率'
      },
      {
        prop: 'status',
        width: 90,
        label: '投诉率'
      }
    ],
    stripe: true,
    border: true,
    outBorder: true,
    row: [
  //     {
  //         "id": 1,
  //         "status": '1',
  //         "datetime": "04-01",
  //         "sign_in_time": '',
  //         "sign_out_time": '00',
  //         "work_hour": 8,
  //     }
    ],
  

  },
  

  methods: {

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function () {
      this.data.buttons[5].checked=true;
      this.setData({
        buttons: this.data.buttons,
      })
    },
    radioButtonTap: function (e) {
      console.log(e)
      let id = e.currentTarget.dataset.id
      console.log(id)
      for (let i = 0; i < this.data.row.length; i++) {
        this.data.row[i].status=id
      }
      for (let i = 0; i < this.data.buttons.length; i++) {
        if (this.data.buttons[i].id == id) {
          //当前点击的位置为true即选中
          this.data.buttons[i].checked = true;
        }
        else {
          //其他的位置为false
          this.data.buttons[i].checked = false;
        }
      }
      this.setData({
        buttons: this.data.buttons,
        
      })
      this.setData({
        row:this.data.row,
        
      })
      
    },
    
    //搜索框
    search(e) {
      const { value } = e.detail;
      const list = [
        'tdesign-vue',
        'tdesign-react',
        'tdesign-miniprogram',
        'tdesign-angular',
        'tdesign-mobile-vue',
        'tdesign-mobile-react',
      ];
      this.setData({
        resultList: value ? list.filter((v) => v.includes(value)) : [],
      });
    },

    
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady:function() {
    },

    wtest(){
      console.log(3333333333)
    },
    /**
     * 生命周期函数--监听页面显示
     */
    onShow:function() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide:function() {
      
    },
 
  },

    
})
export default {
  
}


